<template>
    <div>
        <button @click="sendMsgToParent">向父组件传值</button>
    </div>
</template>

<script>
export default {
    methods: {
        sendMsgToParent: function() {
            this.$emit("childmsg", "hello world!");
        }
    }
};
</script>